package com.zhouxiaoge.集合;

/**
 * @author 周明阳
 * mail:gqzmy@outlook.com
 * 时间:2018-05-08 10:26
 */

public class Item implements Comparable<Item> {

    private String description;
    private int partNumber;
    private int age;

    public Item(String description, int partNumber, int age) {
        this.description = description;
        this.partNumber = partNumber;
        this.age = age;
    }

    public String getDescription() {
        return description;
    }

    public int getAge() {
        return age;
    }

    @Override
    public String toString() {
        return "Item{" + "description='" + description + '\'' + ", partNumber=" + partNumber + ", age=" + age + '}';
    }

    @Override
    public int compareTo(Item o) {
        return Integer.compare(partNumber, o.partNumber);
    }

}
